package edu.ustb.eureka.contract;

import edu.ustb.sc.definitions.ContractActionInfo;
import edu.ustb.sc.definitions.ContractPartyInfo;
import edu.ustb.sc.definitions.SpescConditionCheckStatus;
import edu.ustb.sc.definitions.SpescContractTerm;
import edu.ustb.sc.definitions.SpescTermActionQualifierEnum;
import edu.ustb.sc.definitions.TermLogicEnum;

/**
 * term_1: Customer can request(Discover)
 */
public class DiscoveryContractTerm1 extends SpescContractTerm<DiscoveryContract> {

	public DiscoveryContractParty partyInfo = new DiscoveryContractParty("Customer");

	public static SpescTermActionQualifierEnum qualifier = SpescTermActionQualifierEnum.Can;

	public static String actionName = "request";

	public DiscoveryContractTerm1() {
	}

	public DiscoveryContractTerm1(ContractActionInfo actionInfo) {
		this.actionInfo = actionInfo;
	}

	@Override
	public TermLogicEnum getLogic() {
		return TermLogicEnum.Conditional;
	}

	@Override
	public String getTermName() {
		return "term_1";
	}

	@Override
	public SpescTermActionQualifierEnum getQualifier() {
		return qualifier;
	}

	@Override
	public ContractPartyInfo getPartyInfo() {
		return partyInfo;
	}

	@Override
	public SpescConditionCheckStatus whenPreCondition(DiscoveryContract contract, Object... param) {
		return SpescConditionCheckStatus.Yes;
	}

	@Override
	public SpescConditionCheckStatus wherePostCondition(DiscoveryContract contract, Object... param) {
		return SpescConditionCheckStatus.Yes;
	}

	public String getActionName() {
		return actionName;
	}
}
